<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>EMIO总线式数字IO模块EIO系列 使用手册 v2.10</title><link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 40px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px !important; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  html.blink-to-pdf { font-size: 13px; }
  .typora-export #write { padding-left: 32px; padding-right: 32px; padding-bottom: 0px; break-after: avoid; }
  .typora-export #write::after { height: 0px; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: hidden; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none 0s ease 0s; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="mermaid"] svg, [lang="flow"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
svg[id^="mermaidChart"] { line-height: 1em; }


:root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
html { font-size: 16px; }
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
#write { max-width: 860px; margin: 0px auto; padding: 30px 30px 100px; }
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
a { color: rgb(65, 131, 196); }
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
h1 tt, h1 code { font-size: inherit; }
h2 tt, h2 code { font-size: inherit; }
h3 tt, h3 code { font-size: inherit; }
h4 tt, h4 code { font-size: inherit; }
h5 tt, h5 code { font-size: inherit; }
h6 tt, h6 code { font-size: inherit; }
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
h3 { font-size: 1.5em; line-height: 1.43; }
h4 { font-size: 1.25em; }
h5 { font-size: 1em; }
h6 { font-size: 1em; color: rgb(119, 119, 119); }
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
li > ol, li > ul { margin: 0px; }
hr { height: 2px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border: 0px none; overflow: hidden; box-sizing: content-box; }
li p.first { display: inline-block; }
ul, ol { padding-left: 30px; }
ul:first-child, ol:first-child { margin-top: 0px; }
ul:last-child, ol:last-child { margin-bottom: 0px; }
blockquote { border-left: 4px solid rgb(223, 226, 229); padding: 0px 15px; color: rgb(119, 119, 119); }
blockquote blockquote { padding-right: 0px; }
table { padding: 0px; word-break: initial; }
table tr { border-top: 1px solid rgb(223, 226, 229); margin: 0px; padding: 0px; }
table tr:nth-child(2n), thead { background-color: rgb(248, 248, 248); }
table tr th { font-weight: bold; border-width: 1px 1px 0px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: rgb(223, 226, 229); border-right-color: rgb(223, 226, 229); border-left-color: rgb(223, 226, 229); border-image: initial; border-bottom-style: initial; border-bottom-color: initial; margin: 0px; padding: 6px 13px; }
table tr td { border: 1px solid rgb(223, 226, 229); margin: 0px; padding: 6px 13px; }
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
.CodeMirror-lines { padding-left: 4px; }
.code-tooltip { box-shadow: rgba(0, 28, 36, 0.3) 0px 1px 1px 0px; border-top: 1px solid rgb(238, 242, 242); }
.md-fences, code, tt { border: 1px solid rgb(231, 234, 237); background-color: rgb(248, 248, 248); border-radius: 3px; padding: 2px 4px 0px; font-size: 0.9em; }
code { background-color: rgb(243, 244, 244); padding: 0px 2px; }
.md-fences { margin-bottom: 15px; margin-top: 15px; padding-top: 8px; padding-bottom: 6px; }
.md-task-list-item > input { margin-left: -1.3em; }
@media print {
  html { font-size: 13px; }
  table, pre { break-inside: avoid; }
  pre { overflow-wrap: break-word; }
}
.md-fences { background-color: rgb(248, 248, 248); }
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
.md-mathjax-midline { background: rgb(250, 250, 250); }
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
.md-image > .md-meta { border-radius: 3px; padding: 2px 0px 0px 4px; font-size: 0.9em; color: inherit; }
.md-tag { color: rgb(167, 167, 167); opacity: 1; }
.md-toc { margin-top: 20px; padding-bottom: 20px; }
.sidebar-tabs { border-bottom: none; }
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
#typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
.mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
.md-lang { color: rgb(180, 101, 77); }
.html-for-mac .context-menu { --item-hover-bg-color: #E6F0FE; }
#md-notification .btn { border: 0px; }
.dropdown-menu .divider { border-color: rgb(229, 229, 229); }
.ty-preferences .window-content { background-color: rgb(250, 250, 250); }
.ty-preferences .nav-group-item.active { color: white; background: rgb(153, 153, 153); }

 .typora-export li, .typora-export p, .typora-export,  .footnote-line {white-space: normal;} 
</style>
</head>
<body class='typora-export os-windows' >
<div  id='write'  class = 'is-node'><h1><a name="emio总线式数字io模块eio系列-使用手册-v210" class="md-header-anchor"></a><span>EMIO总线式数字IO模块EIO系列 使用手册 v2.10</span></h1><h1><a name="第1章-emio数字io模块硬件" class="md-header-anchor"></a><span>第1章 EMIO数字IO模块硬件</span></h1><h2><a name="11-功能介绍" class="md-header-anchor"></a><span>1.1 功能介绍</span></h2><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/104757_c68d0261_1360849.png"></div>
<p align="center">图 1.1 总线式系统架构</p><p>&emsp;&emsp;<span>EMIO数字IO模块系列采用XILINX FPGA作为主处理器，以工业以太网络总线为载体，采用专用封闭协议保证通讯的稳定性及响应性，总线通讯周期1ms，自动实现丢包重发机制，支持断线重连中断事件，支持多模块串联，支持与国内外运动控制卡IO卡同时使用，支持与EtherCAT主站同时使用。软件上提供SDK API函数库开发包，驱动及丰富例程，支持WinXP~Win10 32/64位系统上使用VC++ C# VB LabVIEW QT Python等高级语言的开发。</span></p><p>&emsp;&emsp;<span>EMIO数字IO模块系列</span><strong><span>不需要额外的主站系统/主站卡，只需要用超6类双屏蔽网线与主机串联，上位机用API函数库编译应用程序就可以实时控制数字IO模块</span></strong><span>。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/104858_64319025_1360849.png"></div>
<p align="center">图1.1.2 EIO2416功能介绍</p>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105033_ff16bc61_1360849.png"></div>
<p align="center">图1.1.3 EIO4832功能介绍</p><h2><a name="12-安装尺寸" class="md-header-anchor"></a><span>1.2 安装尺寸</span></h2><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105052_9cd94d22_1360849.png"></div>
<p align="center">图1.2.1 EIO2416安装尺寸</p>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105110_0e5d590b_1360849.png"></div>
<p align="center">图1.2.2 EIO4832安装尺寸</p><h2><a name="13-端子定义" class="md-header-anchor"></a><span>1.3 端子定义</span></h2><figure><table><thead><tr><th><span>PIN</span></th><th><span>J0</span></th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>1</span></td><td><span>FG</span></td><td><span>外壳接地</span></td></tr><tr><td><span>2</span></td><td><span>EGND</span></td><td><span>0V</span></td></tr><tr><td><span>3</span></td><td><span>E24V</span></td><td><span>+24V</span></td></tr></tbody></table></figure><p align="center">表1.1 电源定义</p><figure><table><thead><tr><th><span>PIN</span></th><th><span>J1</span></th><th>&nbsp;</th><th><span>J2</span></th><th>&nbsp;</th><th><span>J3</span></th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>1</span></td><td><span>DI0</span></td><td><span>输入0</span></td><td><span>DI12</span></td><td><span>输入12</span></td><td><span>DO0</span></td><td><span>输出0</span></td></tr><tr><td><span>2</span></td><td><span>DI1</span></td><td><span>输入1</span></td><td><span>DI13</span></td><td><span>输入13</span></td><td><span>DO1</span></td><td><span>输出1</span></td></tr><tr><td><span>3</span></td><td><span>DI2</span></td><td><span>输入2</span></td><td><span>DI14</span></td><td><span>输入14</span></td><td><span>DO2</span></td><td><span>输出2</span></td></tr><tr><td><span>4</span></td><td><span>DI3</span></td><td><span>输入3</span></td><td><span>DI15</span></td><td><span>输入15</span></td><td><span>DO3</span></td><td><span>输出3</span></td></tr><tr><td><span>5</span></td><td><span>DI4</span></td><td><span>输入4</span></td><td><span>DI16</span></td><td><span>输入16</span></td><td><span>DO4</span></td><td><span>输出4</span></td></tr><tr><td><span>6</span></td><td><span>DI5</span></td><td><span>输入5</span></td><td><span>DI17</span></td><td><span>输入17</span></td><td><span>DO5</span></td><td><span>输出5</span></td></tr><tr><td><span>7</span></td><td><span>DI6</span></td><td><span>输入6</span></td><td><span>DI18</span></td><td><span>输入18</span></td><td><span>DO6</span></td><td><span>输出6</span></td></tr><tr><td><span>8</span></td><td><span>DI7</span></td><td><span>输入7</span></td><td><span>DI19</span></td><td><span>输入19</span></td><td><span>DO7</span></td><td><span>输出7</span></td></tr><tr><td><span>9</span></td><td><span>DI8</span></td><td><span>输入8</span></td><td><span>DI20</span></td><td><span>输入20</span></td><td><span>DO8</span></td><td><span>输出8</span></td></tr><tr><td><span>10</span></td><td><span>DI9</span></td><td><span>输入9</span></td><td><span>DI21</span></td><td><span>输入21</span></td><td><span>DO9</span></td><td><span>输出9</span></td></tr><tr><td><span>11</span></td><td><span>DI10</span></td><td><span>输入10</span></td><td><span>DI22</span></td><td><span>输入22</span></td><td><span>DO10</span></td><td><span>输出10</span></td></tr><tr><td><span>12</span></td><td><span>DI11</span></td><td><span>输入11</span></td><td><span>DI23</span></td><td><span>输入23</span></td><td><span>DO11</span></td><td><span>输出11</span></td></tr><tr><td><span>13</span></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><span>DO12</span></td><td><span>输出12</span></td></tr><tr><td><span>14</span></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><span>DO13</span></td><td><span>输出13</span></td></tr><tr><td><span>15</span></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><span>DO14</span></td><td><span>输出14</span></td></tr><tr><td><span>16</span></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><span>DO15</span></td><td><span>输出15</span></td></tr></tbody></table></figure><p align="center">表1.2 EIO2416端子定义</p><figure><table><thead><tr><th><span>PIN</span></th><th><span>J1</span></th><th>&nbsp;</th><th><span>J2</span></th><th>&nbsp;</th><th><span>J3</span></th><th>&nbsp;</th><th><span>J4</span></th><th>&nbsp;</th><th><span>J5</span></th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>1</span></td><td><span>DI0</span></td><td><span>输入0</span></td><td><span>DI16</span></td><td><span>输入16</span></td><td><span>DI32</span></td><td><span>输入32</span></td><td><span>DO0</span></td><td><span>输出0</span></td><td><span>DO16</span></td><td><span>输出16</span></td></tr><tr><td><span>2</span></td><td><span>DI1</span></td><td><span>输入1</span></td><td><span>DI17</span></td><td><span>输入17</span></td><td><span>DI33</span></td><td><span>输入33</span></td><td><span>DO1</span></td><td><span>输出1</span></td><td><span>DO17</span></td><td><span>输出17</span></td></tr><tr><td><span>3</span></td><td><span>DI2</span></td><td><span>输入2</span></td><td><span>DI18</span></td><td><span>输入18</span></td><td><span>DI34</span></td><td><span>输入34</span></td><td><span>DO2</span></td><td><span>输出2</span></td><td><span>DO18</span></td><td><span>输出18</span></td></tr><tr><td><span>4</span></td><td><span>DI3</span></td><td><span>输入3</span></td><td><span>DI19</span></td><td><span>输入19</span></td><td><span>DI35</span></td><td><span>输入35</span></td><td><span>DO3</span></td><td><span>输出3</span></td><td><span>DO19</span></td><td><span>输出19</span></td></tr><tr><td><span>5</span></td><td><span>DI4</span></td><td><span>输入4</span></td><td><span>DI20</span></td><td><span>输入20</span></td><td><span>DI36</span></td><td><span>输入36</span></td><td><span>DO4</span></td><td><span>输出4</span></td><td><span>DO20</span></td><td><span>输出20</span></td></tr><tr><td><span>6</span></td><td><span>DI5</span></td><td><span>输入5</span></td><td><span>DI21</span></td><td><span>输入21</span></td><td><span>DI37</span></td><td><span>输入37</span></td><td><span>DO5</span></td><td><span>输出5</span></td><td><span>DO21</span></td><td><span>输出21</span></td></tr><tr><td><span>7</span></td><td><span>DI6</span></td><td><span>输入6</span></td><td><span>DI22</span></td><td><span>输入22</span></td><td><span>DI38</span></td><td><span>输入38</span></td><td><span>DO6</span></td><td><span>输出6</span></td><td><span>DO22</span></td><td><span>输出22</span></td></tr><tr><td><span>8</span></td><td><span>DI7</span></td><td><span>输入7</span></td><td><span>DI23</span></td><td><span>输入23</span></td><td><span>DI39</span></td><td><span>输入39</span></td><td><span>DO7</span></td><td><span>输出7</span></td><td><span>DO23</span></td><td><span>输出23</span></td></tr><tr><td><span>9</span></td><td><span>DI8</span></td><td><span>输入8</span></td><td><span>DI24</span></td><td><span>输入24</span></td><td><span>DI40</span></td><td><span>输入40</span></td><td><span>DO8</span></td><td><span>输出8</span></td><td><span>DO24</span></td><td><span>输出24</span></td></tr><tr><td><span>10</span></td><td><span>DI9</span></td><td><span>输入9</span></td><td><span>DI25</span></td><td><span>输入25</span></td><td><span>DI41</span></td><td><span>输入41</span></td><td><span>DO9</span></td><td><span>输出9</span></td><td><span>DO25</span></td><td><span>输出25</span></td></tr><tr><td><span>11</span></td><td><span>DI10</span></td><td><span>输入10</span></td><td><span>DI26</span></td><td><span>输入26</span></td><td><span>DI42</span></td><td><span>输入42</span></td><td><span>DO10</span></td><td><span>输出10</span></td><td><span>DO26</span></td><td><span>输出26</span></td></tr><tr><td><span>12</span></td><td><span>DI11</span></td><td><span>输入11</span></td><td><span>DI27</span></td><td><span>输入27</span></td><td><span>DI43</span></td><td><span>输入43</span></td><td><span>DO11</span></td><td><span>输出11</span></td><td><span>DO27</span></td><td><span>输出27</span></td></tr><tr><td><span>13</span></td><td><span>DI12</span></td><td><span>输入12</span></td><td><span>DI28</span></td><td><span>输入28</span></td><td><span>DI44</span></td><td><span>输入44</span></td><td><span>DO12</span></td><td><span>输出12</span></td><td><span>DO28</span></td><td><span>输出28</span></td></tr><tr><td><span>14</span></td><td><span>DI13</span></td><td><span>输入13</span></td><td><span>DI29</span></td><td><span>输入29</span></td><td><span>DI45</span></td><td><span>输入45</span></td><td><span>DO13</span></td><td><span>输出13</span></td><td><span>DO29</span></td><td><span>输出29</span></td></tr><tr><td><span>15</span></td><td><span>DI14</span></td><td><span>输入14</span></td><td><span>DI30</span></td><td><span>输入30</span></td><td><span>DI46</span></td><td><span>输入46</span></td><td><span>DO14</span></td><td><span>输出14</span></td><td><span>DO30</span></td><td><span>输出30</span></td></tr><tr><td><span>16</span></td><td><span>DI15</span></td><td><span>输入15</span></td><td><span>DI31</span></td><td><span>输入31</span></td><td><span>DI47</span></td><td><span>输入47</span></td><td><span>DO15</span></td><td><span>输出15</span></td><td><span>DO31</span></td><td><span>输出31</span></td></tr></tbody></table></figure><p align="center">表1.3 EIO4832端子定义</p><h2><a name="14-通用数字输入接口" class="md-header-anchor"></a><span>1.4 通用数字输入接口</span></h2><p>&emsp;&emsp;<span>EIO2416模块有 24 路通用数字输入信号(NPN)，EIO4832模块有 48 路通用数字输入信号(NPN)。所有输入接口均加有光电隔离元件，可以有效隔离外部电路的干扰，以提高系统的可靠性。通用数字输入信号接口原理图如图1.6所示。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105139_b780c5cd_1360849.png"></div>
<p align="center">图1.4.1 通用数字输入电路</p><h2><a name="15-通用数字输出接口" class="md-header-anchor"></a><span>1.5 通用数字输出接口</span></h2><p>&emsp;&emsp;<span>EIO2416模块有 16 路通用数字输出信号(NPN)，EIO4832模块有 32 路通用数字输入信号(NPN)。由 MOS 管驱动，其最大工作电流为</span><strong><span>1A</span></strong><span>，可用于控制继电器、电磁阀、信号灯或其它设备，如图1.7所示。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105614_758cbdee_1360849.png"></div>
<p align="center">图1.5.1 通用数字输出电路</p><h1><a name="第2章-emio数字io模块软件" class="md-header-anchor"></a><span>第2章 EMIO数字IO模块软件</span></h1><h2><a name="21-驱动api函数库及例程安装" class="md-header-anchor"></a><span>2.1 驱动API函数库及例程安装</span></h2><p>&emsp;&emsp;<span>目前仅提供Windows安装包(支持Windows XP/Vista/Win7/Win10)。</span></p><p>&emsp;&emsp;<span>下载地址: </span><a href='https://raw.githubusercontent.com/yunshi-tech/EMIO/master/YSEMIO_Setup.exe' target='_blank' class='url'>https://raw.githubusercontent.com/yunshi-tech/EMIO/master/YSEMIO_Setup.exe</a></p><p>&emsp;&emsp;<span>双击安装包进行驱动，API及例程的安装。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105728_f71527dd_1360849.png"></div>
<p align="center">图2.1.1 驱动安装向导</p>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105746_79fa8345_1360849.png"></div>
<p align="center">图2.1.2 驱动安装向导</p>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105758_b878bcb0_1360849.png"></div>
<p align="center">图2.1.3 选择安装目录</p>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105854_803ab715_1360849.png"></div>
<p align="center">图2.1.4 安装完成</p><p>&emsp;&emsp;<span>安装完成后双击桌面上的YSEMIO Utility快捷方式图标运行调试程序。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/105946_532b8a28_1360849.png"></div>
<p align="center">图2.1.5 调试工具YSEMIO Utility</p><p>&emsp;&emsp;<span>双击DO图标可以反向操作DO等，当有断线及重连时下面输出列表会有提示。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110156_a5ac95fc_1360849.png"></div>
<p align="center">图2.1.6 YSEMIO Utility操作</p><h2><a name="22-编程指南" class="md-header-anchor"></a><span>2.2 编程指南</span></h2><h3><a name="221-visual-c-mfc应用程序开发" class="md-header-anchor"></a><span>2.2.1 Visual C++ MFC应用程序开发</span></h3><ol start='' ><li><span>启动Visual Studio 2010，文件-新建-项目-Visual C++，在MFC应用向导下一步中选择 基于对话框 类型并完成。</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110301_6dfdd464_1360849.png"></div>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110323_a415dbd9_1360849.png"></div>
<p align="center">图2.2.1.1 新建对话框应用程序</p><ol start='2' ><li><span>设置 项目-属性，弹出项目属性页对话框(Alt+F7)。</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110339_b564ee43_1360849.png"></div>
<p align="center">图2.2.1.2 打开项目属性</p><ol start='3' ><li><span>在项目属性页对话框，在 配置属性-VC++目录中，分别设置包含目录和库目录为安装目录位置：</span></li></ol><p>&emsp;&emsp;<span>包含目录: C:\Program Files\EMIO\Include</span></p><p>&emsp;&emsp;<span>库目录: C:\Program Files\EMIO\Lib\x86 (Win32程序)</span></p><p>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<span>C:\Program Files\EMIO\Lib\x64 (Win64程序)</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/114935_33e10c6c_1360849.png"></div>
<div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/114952_5262c46a_1360849.png"></div>
<p align="center">图2.2.1.3 设置包含目录和库目录</p><ol start='4' ><li><span>在对话框程序头文件中，加入包括头文件和库文件的代码：</span></li></ol><p>&emsp;&emsp;<span>#include &quot;YSEMIODef.h&quot;</span></p><p>&emsp;&emsp;<span>#include &quot;YSEMIO.h&quot;</span></p><p>&emsp;&emsp;<span>#pragma comment (lib,&quot;YSEMIO.lib&quot;)</span></p><p>&emsp;&emsp;<span>到此，就可以调用EMIO API函数库中的任何函数，开始编写应用程序了。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110401_bf261ef4_1360849.png"></div>
<p align="center">图2.2.1.4 加入包括头文件和库文件</p><ol start='5' ><li><span>EMIO API函数库的一般使用流程如下：</span></li></ol><p>&emsp;&emsp;<span>(1). 获取所有已经实际连接上的从站模块的总数及其类型数组。</span></p><p>&emsp;&emsp;<span>(2). 打开并连接指定数目和指定模块类型数组的总线从站模块。</span></p><p>&emsp;&emsp;<span>(3). 操作数字输入输出。</span></p><p>&emsp;&emsp;<span>(4). 关闭总线从站模块。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110419_873aceee_1360849.png"></div>
<p align="center">图2.2.1.5 VC++函数库使用流程</p><ol start='6' ><li><span>EMIO API函数库的断线/重连事件使用流程如下：</span></li></ol><p>&emsp;&emsp;<span>(1). 自定义断线/重连事件处理函数。</span></p><p>&emsp;&emsp;<span>(2). 在打开模块后注册已定义的断线/重连事件函数。</span></p><p>&emsp;&emsp;<span>(3). 网络断线/重连后自动执行断线/重连事件处理函数一次。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110435_0d4eac14_1360849.png"></div>
<p align="center">图2.2.1.6 VC++断线/重连事件使用流程</p><p>&emsp;&emsp;<span>EMIO API函数库详细具体使用方法，请参考例程。</span></p><p><span> </span></p><p><span> </span></p><h3><a name="222-visual-c-windows窗体应用程序开发" class="md-header-anchor"></a><span>2.2.2 Visual C# Windows窗体应用程序开发</span></h3><ol start='' ><li><span>启动Visual Studio 2010，文件-新建-项目-Visual C#，选择Windows窗体应用程序。</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110458_2ad68929_1360849.png"></div>
<p align="center">图2.2.2.1 新建Windows窗体应用程序</p><ol start='2' ><li><span>项目-添加现有项，选择C:\Program Files\EMIO\Include\YSEMIO.cs文件。</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110519_b4cb99b8_1360849.png"></div>
<p align="center">图2.2.2.2 添加现有项YSEMIO.cs</p><ol start='3' ><li><span>在Form1.cs中添加使用命名空间代码using YSEMIO;</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110620_9f08b8d8_1360849.png"></div>
<p align="center">图2.2.2.3 使用命名空间YSEMIO</p><p>&emsp;&emsp;<span>到此，就可以调用EMIO API函数库中的任何函数，开始编写应用程序了。</span></p><p><span> </span></p><ol start='4' ><li><span>EMIO API函数库的一般使用流程如下：</span></li></ol><p>&emsp;&emsp;<span>(1). 获取所有已经实际连接上的从站模块的总数及其类型数组。</span></p><p>&emsp;&emsp;<span>(2). 打开并连接指定数目和指定模块类型数组的总线从站模块。</span></p><p>&emsp;&emsp;<span>(3). 操作数字输入输出。</span></p><p>&emsp;&emsp;<span>(4). 关闭总线从站模块。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110749_5cb47e97_1360849.png"></div>
<p align="center">图2.2.2.4 VC#函数库使用流程</p><ol start='5' ><li><span>EMIO API函数库的断线/重连事件使用流程如下：</span></li></ol><p>&emsp;&emsp;<span>(1). 自定义断线/重连事件处理函数。</span></p><p>&emsp;&emsp;<span>(2). 定义并新建断线/重连事件委托。</span></p><p>&emsp;&emsp;<span>(3). 在打开模块后注册已定义的断线/重连事件委托。</span></p><p>&emsp;&emsp;<span>(4). 网络断线/重连后自动执行断线/重连事件处理函数一次。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110835_d353e3ac_1360849.png"></div>
<p align="center">图2.2.2.5 VC# 断线/重连事件使用流程</p><h3><a name="223-visual-basicnet-windows窗体应用程序开发" class="md-header-anchor"></a><span>2.2.3 Visual Basic.NET Windows窗体应用程序开发</span></h3><ol start='' ><li><span>启动Visual Studio 2010，文件-新建-项目-Visual Basic，选择Windows窗体应用程序。</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/110908_3a323c0d_1360849.png"></div>
<p align="center">图2.2.3.1 新建Windows窗体应用程序</p><ol start='2' ><li><span>项目-添加现有项，选择C:\Program Files\EMIO\Include\YSEMIO.vb文件。</span></li></ol><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/111033_14162b4d_1360849.png"></div>
<p align="center">图2.2.3.2 添加现有项YSEMIO.vb</p><p><span>到此，就可以调用EMIO API函数库中的任何函数，开始编写应用程序了。</span></p><ol start='3' ><li><span>EMIO API函数库的一般使用流程与</span><a href='#_2.2.1_Visual_C++'><span>图2.2.1.5</span></a><span> VC++函数库使用流程一致。</span></li><li><span>EMIO API函数库的断线/重连事件使用流程如下：</span></li></ol><p>&emsp;&emsp;<span>(1). 自定义断线/重连事件处理函数。</span></p><p>&emsp;&emsp;<span>(2). 定义并新建断线/重连事件委托。</span></p><p>&emsp;&emsp;<span>(3). 在打开模块后注册已定义的断线/重连事件委托。</span></p><p>&emsp;&emsp;<span>(4). 网络断线/重连后自动执行断线/重连事件处理函数一次。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/115104_1546f171_1360849.png"></div>
<p align="center">图2.2.3.3 VB.NET 断线/重连事件使用流程</p><h1><a name="第3章-emio数字io模块api函数" class="md-header-anchor"></a><span>第3章 EMIO数字IO模块API函数</span></h1><h2><a name="31-模块系统函数" class="md-header-anchor"></a><span>3.1 模块系统函数</span></h2><h3><a name="311-emiogetconnectedstations" class="md-header-anchor"></a><span>3.1.1 EMIO_Get_Connected_Stations()</span></h3><p><span>获取所有已经实际连接上的从站模块的总数及其类型数组。</span></p><figure><table><thead><tr><th>&nbsp;</th><th style='text-align:left;' ><strong><span>EMIO_Get_Connected_Stations</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td style='text-align:left;' ><span>short   EMIO_Get_Connected_Stations( unsigned short *Connected_Numbers,</span><br><span>  unsigned short *Connected_Station_Types, unsigned short Unicode = 1  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td style='text-align:left;' ><span>获取所有已经实际连接上的从站模块的总数目 Connected_Numbers及其类型Connected_Station_Types数组指针。</span><br><span>类型定义如下：  ( 0 : StationTypeIO2416 )  ( 1 : StationTypeIO4832 )</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td style='text-align:left;' >&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td style='text-align:left;' ><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned short*</span></td><td style='text-align:left;' ><span>Connected_Numbers</span></td><td><span>输出</span></td><td><span>返回实际连接的从站模块总数目</span></td></tr><tr><td><span>unsigned short*</span></td><td style='text-align:left;' ><span>Connected_Station_Types</span></td><td><span>输出</span></td><td><span>返回实际连接的所有从站模块的类型数组指针</span></td></tr><tr><td><span>unsigned short</span></td><td style='text-align:left;' ><span>Unicode</span></td><td><span>输入</span></td><td><span>程序是否使用Unicode字符集</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td style='text-align:left;' ><span>unsigned short uiStationNums  = 0;  </span><br><span>//还不知道实际连接的从站模块数目</span><br><span>unsigned short uiSationTypes[56] =  {0};  </span><br><span>//获取所有已经实际连接上的从站模块的总数及其类型数组</span><br><span>short siRtn = EMIO_Get_Connected_Stations(&amp;uiStationNums,  uiSationTypes);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td style='text-align:left;' ><span>ushort   Station_Nums  = 0;  </span><br><span>ushort[]   Station_Types  = new ushort[56];  </span><br><span>short  siRtn = EMIO.EMIO_Get_Connected_Stations(ref Station_Nums, ref Station_Types[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="312-emiogetconnectedstationnums" class="md-header-anchor"></a><span>3.1.2 EMIO_Get_Connected_Station_Nums()</span></h3><p><span>获取所有已经实际连接上的从站模块的总数目。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Connected_Station_Nums</span></strong></th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Get_Connected_Station_Nums();</span></td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取并返回所有已经实际连接上的从站模块的总数目</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short iStationNums =  EMIO_Get_Connected_Station_Nums();</span></td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short iStationNums =  EMIO.EMIO_Get_Connected_Station_Nums();</span></td></tr></tbody></table></figure><h3><a name="313-emiogetconnectedstationtype" class="md-header-anchor"></a><span>3.1.3 EMIO_Get_Connected_Station_Type()</span></h3><p><span>获取指定站点ID序号从站模块的类型数组。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Connected_Station_Type</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_ Get_Connected_Station_Type(unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>根据从站模块的站点ID序号 Station_Number获取并返回该模块的类型。类型定义如下：(  0 : StationTypeIO2416 ) ( 1 : StationTypeIO4832 )</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>指定从站模块的站点ID序号</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>//首先获取已经实际连接上的从站模块的总数目  </span><br><span>unsigned short uiStationNums = EMIO_Get_Connected_Station_Nums();  </span><br><span>//根据从站模块的总数目分配存储所有从站类型的数组  </span><br><span>unsigned short* puiStationType = new unsigned short[uiStationNums];  for(unsigned short idx=0;  idx&lt;uiStationNums; idx++) {         </span><br><span>//根据从站模块的站点ID序号 Station_Number获取并返回该模块的类型。      puiStationType[idx] =  EMIO_ Get_Connected_Station_Type (idx); </span><br><span>}  </span><br><span>delete   puiStationType;</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>ushort    uiStationNums =  EMIO.EMIO_Get_Connected_Station_Nums();  ushort[] puiStationType = new ushort[uiStationNums];  </span><br><span>for(ushort  idx=0; idx&lt;uiStationNums; idx++) </span><br><span>{          </span><br><span>puiStationType[idx] = EMIO.EMIO_Get_Connected_Station_Type(idx);   </span><br><span>}</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="314-emioopen" class="md-header-anchor"></a><span>3.1.4 EMIO_Open()</span></h3><p><span>打开总线从站模块。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Open</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Open(unsigned short Connection_Numbers, unsigned short  *Station_Types);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>打开并连接指定数目 Connection_Numbers和指定模块类型 Station_Types数组的总线从站模块</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned  short</span></td><td><span>Connection_Numbers</span></td><td><span>输入</span></td><td><span>指定需要打开的所有从站模块的总数目。  注意这个总数目不一定与实际连接的所有从站模块的总数目相同，最好由 EMIO_  Get_Connected_Station_Nums()获取实际连接上的从站模块的总数目</span></td></tr><tr><td><span>unsigned  short*</span></td><td><span>Station_Types</span></td><td><span>输入</span></td><td><span>指定需要打开的所有从站模块的类型数组指针</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>unsigned  short iStationNums = 0;  </span><br><span>//这时还不知道实际连接的从站模块数目，预定义56个  </span><br><span>unsigned  short iSationTypes[56] = {0};  </span><br><span>//获取所有已经实际连接上的从站模块的总数目及其类型数组  </span><br><span>short  siRtn = EMIO_Get_Connected_Stations(&amp;iStationNums, iSationTypes);  </span><br><span>//打开所有从站模块  </span><br><span>siRtn  = EMIO_Open(iStationNums, iSationTypes);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>ushort   Station_Nums = 0;  ushort[] Station_Types = new ushort[56];  //获取所有已经实际连接上的从站模块的总数目及其类型数组  short siRtn  = EMIO.EMIO_Get_Connected_Stations(ref Station_Nums,  ref Station_Types[0]);  //打开所有从站模块  siRtn = EMIO.EMIO_Open(Station_Nums, ref  Station_Types[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="315-emioopenex" class="md-header-anchor"></a><span>3.1.5 EMIO_OpenEx()</span></h3><p><span>打开总线从站模块扩展。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_OpenEx</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_OpenEx(unsigned short Connection_Numbers , unsigned short  *Station_Numbers, unsigned short *Station_Types);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>打开并连接指定数目  Connection_Numbers，指定从站模块的站点ID序号Station_Numbers数组，指定模块类型 Station_Types数组的总线从站模块。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned short</span></td><td><span>Connection_Numbers</span></td><td><span>输入</span></td><td><span>指定需要打开的所有从站模块的总数目。  注意这个总数目不一定与实际连接的所有从站模块的总数目相同，最好由 EMIO_ Get_Connected_Station_Nums()获取实际连接上的从站模块的总数目。</span></td></tr><tr><td><span>unsigned short*</span></td><td><span>Station_Numbers</span></td><td><span>输入</span></td><td><span>所有从站模块的站点ID序号数组指针</span></td></tr><tr><td><span>unsigned short*</span></td><td><span>Station_Types</span></td><td><span>输入</span></td><td><span>所有从站模块的类型数组指针</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>//指定需要打开2个从站模块  </span><br><span>unsigned short iStationNums = 2; </span><br><span>//指定从站站点ID序号  unsigned short iSationTypes[2] =  {StationTypeIO2416，StationTypeIO4832};</span><br><span>unsigned short iSationNumbers[2] = {0，1};  //打开2个站点号分别为 {0，1},类型分别为  //{StationTypeIO2416,StationTypeIO4832}的从站模块  </span><br><span>short siRtn = EMIO_OpenEx(iStationNums, iSationNumbers, iSationTypes);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>//指定需要打开2个从站模块</span><br><span>ushort  Station_Nums  = 2;  </span><br><span> //指定从站站点ID序号</span><br><span>ushort[]  Station_Numbers = new ushort[]{0,1};  </span><br><span>//指定从站站点类型  ushort[]  Station_Types  = new ushort[] {  (ushort)StationType.StationTypeIO2416, (ushort)StationType.StationTypeIO4832  };  // 打开总线从站模块</span><br><span>ushort   siRtn =  EMIO.EMIO_OpenEx(Station_Nums, ref Station_Numbers[0], ref Station_Types[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="316-emioclose" class="md-header-anchor"></a><span>3.1.6 EMIO_Close()</span></h3><p><span>关闭总线从站模块。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Close</span></strong></th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Close();</span></td></tr><tr><td><strong><span>说明</span></strong></td><td><span>关闭总线上所有从站模块。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short  siRtn = EMIO_Close();</span></td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short siRtn = EMIO.EMIO_Close();</span></td></tr></tbody></table></figure><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><h2><a name="32-模块通用数字输入输出函数" class="md-header-anchor"></a><span>3.2 模块通用数字输入输出函数</span></h2><h3><a name="321-emiogetinput" class="md-header-anchor"></a><span>3.2.1 EMIO_Get_Input()</span></h3><p><span>获取指定站点的数字输入逻辑状态。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Input</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Get_Input(unsigned long *All_Input_Logic1, unsigned long  *All_Input_Logic2, unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定站点ID序号Station_Number从站模块的所有数字输入状态并返回到 All_Input_Logic1(Input31~  Input0)和 All_Input_Logic2(Input47~ Input32)。注意：返回值是按</span><strong><span>位</span></strong><span>对应的，如返回65536即0xffff（二进制1111 1111 1111 1111）即16个DI均为1，16个LED灯均为熄灭状态。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned long</span><strong><span>*</span></strong></td><td><span>All_Input_Logic1</span></td><td><span>输出</span></td><td><span>按</span><strong><span>位</span></strong><span>返回数字输入状态(0 ~0xffffffff)。</span></td></tr><tr><td><span>unsigned long</span><strong><span>*</span></strong></td><td><span>All_Input_Logic2</span></td><td><span>输出</span></td><td><span>按</span><strong><span>位</span></strong><span>返回数字输入状态(0 ~0xffffffff)。</span></td></tr><tr><td><span>unsigned  short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>//获取站点号 gStation_Number[0]的EIO2416所有数字输入DI状态unsigned  long  All_Input_Logic1 =  All_Input_Logic2 = 0;  short siRtn =  0;    </span><br><span>//All_Input_Logic1(DI31  ~ DI0)和  All_Input_Logic2( DI47~  DI32)按</span><strong><span>位</span></strong><span>对应。  </span><br><span>siRtn =  EMIO_Get_Input  (  &amp; All_Input_Logic1  ,&amp; All_Input_Logic2  , gStation_Number[0] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>//获取站点号  gStation_Number[0]的EIO2416所有数字输入DI状态uint AllOutputLogic1=0,  AllOutputLogic2 = 0;  short  siRtn =  0;    //All_Input_Logic1(DI31 ~ DI0)和 All_Input_Logic2( DI47~   DI32)按</span><strong><span>位</span></strong><span>对应。  </span><br><span>siRtn = EMIO.EMIO_Get_Input(ref  AllOutputLogic1, ref AllOutputLogic2, gStation_Numbers[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="322-emiogetinputbit" class="md-header-anchor"></a><span>3.2.2 EMIO_Get_Input_Bit()</span></h3><p><span>获取指定输入位和指定站点的数字输入位逻辑状态。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_ Input _Bit</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Get_ Input _Bit ( unsigned short  Bit_Input_Number, unsigned short *Bit_Input_Logic, unsigned short  Station_Number  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><span>说明</span></td><td><span>获取指定输入位Bit_Input_Number和指定站点ID序号Station_Number从站模块,的输入逻辑状态 Bit_Input_Logic。</span><br><span>注意：输入位Bit_Input_Number 是按值对应设输入的，如值为15即获取DI 15操作。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned  short</span></td><td><span>Bit_Input_Number,</span></td><td><span>输入</span></td><td><span>按值指定数字输入位(0 ~ 31)。</span></td></tr><tr><td><span>unsigned  short*</span></td><td><span>Bit_Input_Logic</span></td><td><span>输出</span></td><td><span>0:   LED灯亮状态  1:   LED灯熄状态</span></td></tr><tr><td><span>unsigned  short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>unsigned   short Bit_Logic = 0;   short  siRtn = 0;  </span><br><span>//获取站点号  gStation_Number[0]的 EIO2416的DI15的输入状态 </span><br><span> siRtn  = EMIO_Get_Input_Bit (15,  &amp;Bit_Logic, gStation_Number[0]);  </span><br><span>//设置站点号  gStation_Number[0]的 EIO2416的DI0的输入状态  </span><br><span>siRtn  =  EMIO_Get_Input_Bit (0,   &amp;Bit_Logic,,   gStation_Number[0]);  </span><br><span>//设置站点号  gStation_Number[1]的 EIO4832的DI31的输入状态  </span><br><span>siRtn  =  EMIO_Get_Input_Bit ( 31,  &amp;Bit_Logic, gStation_Number[1] );  </span><br><span>//设置站点号  gStation_Number[1]的 EIO4832 的DI1的输入状态  </span><br><span>siRtn  =  EMIO_Get_Input_Bit ( 1,  &amp;Bit_Logic, gStation_Number[1] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>ushort  Bit_Logic = 0;  short siRtn = 0;  </span><br><span>//获取站点号 gStation_Number[0]的 EIO2416的DI15的输入状态  </span><br><span>siRtn = EMIO.EMIO_Get_Input_Bit(15, ref   Bit_Logic ,gStation_Numbers[0]);  </span><br><span>//设置站点号 gStation_Number[1]的 EIO4832的DI31的输入状态  siRtn = EMIO.EMIO_Get_Input_Bit(31, ref   Bit_Logic ,gStation_Numbers[1]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="323-emiogetoutput" class="md-header-anchor"></a><span>3.2.3 EMIO_Get_Output()</span></h3><p><span>获取指定站点的数字输出逻辑状态。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Output</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Get_Output(unsigned long*   All_Output_Logic, unsigned  short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定站点ID序号Station_Number从站模块的数字输出状态并返回到All_Output_Logic。</span><br><span>注意：返回值是按</span><strong><span>位</span></strong><span>对应的，如返回65536即0xffff（二进制1111 1111 1111 1111）即16个DO均为1，16个LED灯均为熄灭状态。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned long</span></td><td><span>All_Output_Logic</span></td><td><span>输出</span></td><td><span>返回数字输出状态(0 ~0xffffffff)。</span></td></tr><tr><td><span>unsigned  short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>unsigned long All_Output_Logic = 0;    short siRtn = 0;  </span><br><span>//获取站点号 gStation_Numbers[0]的EIO2416输出状态到 All_Output_Logic  </span><br><span>//如All_Output_Logic = 0xfffe  EIO2416 DO0状态为0，DO1-DO15状态为1  </span><br><span>siRtn = EMIO_Get_Output(  &amp;All_Output_Logic , gStation_Numbers[0]  );  </span><br><span>//获取站点号 gStation_Numbers[1]的EIO4832输出状态到 All_Output_Logic  </span><br><span>//如All_Output_Logic=0xfffffffe  EIO4832 DO0状态为0，DO1-DO31状态为1  </span><br><span>siRtn = EMIO_Get_Output(  &amp;All_Output_Logic , gStation_Numbers[1]  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>uint  AllOutputLogic = 0;    short  siRtn = 0;  </span><br><span>//获取站点号 gStation_Numbers[0]的EIO2416输出状态到 All_Output_Logic  </span><br><span>//如All_Output_Logic =  0xfffe  EIO2416 DO0状态为0，DO1-DO15状态为1  </span><br><span>siRtn  = EMIO.EMIO_Get_Output(ref AllOutputLogic, gStation_Numbers[0]);  </span><br><span>//获取站点号 gStation_Numbers[1]的EIO4832输出状态到 All_Output_Logic  </span><br><span>//如All_Output_Logic=0xfffffffe   EIO4832 DO0状态为0，DO1-DO31状态为1  </span><br><span>siRtn  = EMIO.EMIO_Get_Output(ref  AllOutputLogic, gStation_Numbers[1]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><p><span> </span></p><h3><a name="324-emiogetoutputbit" class="md-header-anchor"></a><span>3.2.4 EMIO_Get_Output_Bit()</span></h3><p><span>获取指定输出位和指定站点的数字输出位逻辑状态。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Output_Bit</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Get_Output_Bit (unsigned short Bit_Output_Number, unsigned short*  Bit_Output_Logic, unsigned short  Station_Number );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定输出位 Bit_Output_Number和指定站点ID序号Station_Number的从站模块的输出逻辑状态Bit_Output_Logic  。</span><br><span>注意：指定输出位Bit_Output_Number是按</span><strong><span>值</span></strong><span>对应的，如值为15即获取DO15状态。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned  short</span></td><td><span>Bit_Output_Number,</span></td><td><span>输入</span></td><td><span>按值指定数字输出位(0 ~ 31)。</span></td></tr><tr><td><span>unsigned  short*</span></td><td><span>Bit_Output_Logic</span></td><td><span>输出</span></td><td><span>0:   LED灯亮状态  1:   LED灯熄状态</span></td></tr><tr><td><span>unsigned  short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>unsigned  short  Bit_Logic = 0;    short siRtn = 0;  </span><br><span>//获取站点号 gStation_Number[0]的 EIO2416的DO15的输入状态  </span><br><span>siRtn =  EMIO_Get_Output_Bit (15, &amp;Bit_Logic,  gStation_Numbers[0]);  </span><br><span>//获取站点号 gStation_Number[0]的 EIO2416的DO0的输入状态  </span><br><span>siRtn =  EMIO_Get_Output_Bit (0,  &amp;Bit_Logic,,  gStation_Numbers[0]);  </span><br><span>//获取站点号 gStation_Number[1]的 EIO4832的DO31的输入状态  </span><br><span>siRtn =  EMIO_Get_Output_Bit ( 31, &amp;Bit_Logic, gStation_Numbers[1] );  </span><br><span>//获取站点号 gStation_Number[1]的 EIO4832 的DO1的输入状态  </span><br><span>siRtn =  EMIO_Get_Output_Bit ( 1,  &amp;Bit_Logic, gStation_Numbers[1] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>ushort   Bit_Logic = 0; short siRtn = 0;  </span><br><span>//获取站点号 gStation_Number[0]的 EIO2416的DO15的输入状态 </span><br><span>EMIO.EMIO_Get_Output_Bit(15,  ref  Bit_Logic, gStation_Numbers[0]);  </span><br><span>//获取站点号 gStation_Number[1]的 EIO4832的DO31的输入状态</span><br><span>  EMIO.EMIO_Get_Output_Bit(31,  ref  Bit_Logic, gStation_Numbers[1]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="325-emiosetoutput" class="md-header-anchor"></a><span>3.2.5 EMIO_Set_Output()</span></h3><p><span>设置指定站点的数字输出逻辑。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Set_Output</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short EMIO_Set_Output(unsigned long All_Output_Logic, unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>设置指定站点ID序号Station_Number从站模块的数字IO输出状态 All_Output_Logic。</span><br><span>注意： All_Output_Logic是按</span><strong><span>位</span></strong><span>对应设输出的，如16个DO均为1即0xffff（二进制1111 1111 1111 1111）其值为65536，熄灭16个LED灯。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned long</span></td><td><span>All_Output_Logic</span></td><td><span>输入</span></td><td><span>按</span><strong><span>位</span></strong><span>设置的数字IO输出状态(0 ~0xffffffff)。</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short siRtn = 0;  </span><br><span>//设置站点号 gStation_Number[0]的 EIO2416的16DO输出为0 点亮LED灯  </span><br><span>siRtn  = EMIO_Set_Output( 0x0,     gStation_Numbers[0] );  </span><br><span>//设置站点号 gStation_Number[0]的 EIO2416的16DO输出为1 熄灭LED灯  </span><br><span>siRtn  = EMIO_Set_Output( 0xffff,    gStation_Numbers[0] );  </span><br><span>//设置站点号 gStation_Number[1]的 EIO4832 DO0输出为0 DO1-DO31输出为1  </span><br><span>siRtn  = EMIO_Set_Output( 0xfffffffe, gStation_Numbers[1] );  </span><br><span>//设置站点号 gStation_Number[1]的 EIO4832 32DO输出为1 熄灭LED灯  siRtn  = EMIO_Set_Output( 0xffffffff,   gStation_Numbers[1] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span>  </span><strong><span>示例</span></strong></td><td><span>short siRtn = 0;  </span><br><span>//设置站点号 gStation_Number[0]的 EIO2416的16DO输出为0 点亮LED灯  </span><br><span>siRtn = EMIO.EMIO_Set_Output(0x0,    gStation_Numbers[0]);  </span><br><span>//设置站点号 gStation_Number[0]的 EIO2416的16DO输出为1 熄灭LED灯  </span><br><span>siRtn = EMIO.EMIO_Set_Output(0xffff,   gStation_Numbers[0]);  </span><br><span>//设置站点号 gStation_Number[1]的 EIO4832 DO0输出为0，DO1-DO31输出为1  </span><br><span>siRtn = EMIO.EMIO_Set_Output(0xfffffffe, gStation_Numbers[1]);  </span><br><span>//设置站点号 gStation_Number[1]的 EIO4832 32DO输出为1 熄灭LED灯  </span><br><span>siRtn = EMIO.EMIO_Set_Output(0xffffffff,  gStation_Numbers[1]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="326-emiosetoutputbit" class="md-header-anchor"></a><span>3.2.6 EMIO_Set_Output_Bit()</span></h3><p><span>设置指定输出位和指定站点的数字输出位逻辑。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Set_Output_Bit</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short   EMIO_Set_Output_Bit (unsigned short Bit_Output_Number, unsigned short  Bit_Output_Logic, unsigned short  Station_Number );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>设置指定输出位 Bit_Output_Number和指定站点ID序号Station_Number的从站模块的输出逻辑 Bit_Output_Logic 。</span><br><span>注意：指定输出位 Bit_Output_Number是按</span><strong><span>值</span></strong><span>对应设输出的，比如值为15即对DO15操作。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned short</span></td><td><span>Bit_Output_Number,</span></td><td><span>输入</span></td><td><span>按值指定数字输出位(0 ~ 31)。</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Bit_Output_Logic</span></td><td><span>输入</span></td><td><span>0:  点亮LED灯  1:  熄灭LED灯</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short  siRtn = 0;  </span><br><span>//设置站点号 gStation_Numbers[0]的 EIO2416的DO15输出为0 点亮LED灯  siRtn =  EMIO_Set_Output_Bit  (15, 0, gStation_Numbers[0]);  </span><br><span>//设置站点号 gStation_Numbers[0]的 EIO2416的DO0输出为1 熄灭LED灯  siRtn =  EMIO_Set_Output_Bit  (0,  1,  gStation_Numbers[0]);  </span><br><span>//设置站点号 gStation_Numbers[1]的 EIO4832的DO31输出为0 点亮LED灯  siRtn =  EMIO_Set_Output_Bit  (31, 0, gStation_Numbers[1] );  </span><br><span>//设置站点号 gStation_Numbers[1]的 EIO4832 的DO1输出为1 熄灭LED灯  siRtn =  EMIO_Set_Output_Bit  (1,  1,  gStation_Numbers[1]  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short siRtn = 0;  </span><br><span>//设置站点号 gStation_Numbers[0]的 EIO2416的DO15输出为0 点亮LED灯  </span><br><span>siRtn = EMIO.EMIO_Set_Output_Bit(15,  0,  gStation_Numbers[0]  );  </span><br><span>//设置站点号 gStation_Numbers[1]的 EIO4832的DO31输出为0 点亮LED灯  </span><br><span>siRtn = EMIO.EMIO_Set_Output_Bit (31,  0, gStation_Numbers[1] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="327-emioinvoutputbit" class="md-header-anchor"></a><span>3.2.7 EMIO_Inv_Output_Bit()</span></h3><p><span>反向设置指定输出位和指定站点的数字输出位逻辑。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Inv_Output_Bit</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short    EMIO_Inv_Output_Bit (unsigned  short Bit_Output_Number, unsigned short Station_Number );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>反向设置指定输出位 Bit_Output_Number和指定站点ID序号Station_Number的从站模块的数字输出状态。</span><br><span>注意：反向输出位Bit_Output_Number是按</span><strong><span>值</span></strong><span>对应设输出的，如值为15即对DO15操作。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned  short</span></td><td><span>Bit_Output_Number,</span></td><td><span>输入</span></td><td><span>按值指定反向数字输出位(0 ~ 31)。。</span></td></tr><tr><td><span>unsigned  short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short siRtn = 0;  </span><br><span>//反向站点号 gStation_Numbers[0]的 EIO2416的DO15的输出 原LED灯亮变灭  </span><br><span>siRtn =  EMIO_Inv_Output_Bit (15,   gStation_Numbers[0]);  </span><br><span>//反向站点号 gStation_Numbers[1]的 EIO4832的DO31的输出 原LED灯灭变亮  </span><br><span>siRtn =  EMIO_Inv_Output_Bit (31,   gStation_Numbers[1]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  siRtn = 0;  </span><br><span>//反向站点号 gStation_Numbers[0]的 EIO2416的DO15的输出 原LED灯亮变灭  </span><br><span>siRtn  =  EMIO.EMIO_Inv_Output_Bit (15,   gStation_Numbers[0]);  </span><br><span>//反向站点号 gStation_Numbers[1]的 EIO4832的DO31的输出 原LED灯灭变亮  </span><br><span>siRtn  =  EMIO.EMIO_Inv_Output_Bit (31,   gStation_Numbers[1]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><p><span> </span></p><h2><a name="33-模块实用函数" class="md-header-anchor"></a><span>3.3 模块实用函数</span></h2><h3><a name="331-emiogetfirsterrormessage" class="md-header-anchor"></a><span>3.3.1 EMIO_Get_First_Error_Message()</span></h3><p><span>获取系统出现的第一个错误信息。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_First_Error_Message</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short    EMIO_Get_First_Error_Message( LPTSTR Error_Message, unsigned  short  Unicode = 1  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>根据指定字符集类型获取系统出现的第一个错误信息字符数组。Unicode类型定义如下：( 0 : 非Unicode  )  ( 1 : Unicode )</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>LPTSTR</span></td><td><span>Error_Message</span></td><td><span>输出</span></td><td><span>返回系统出现的第一个错误信息</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Unicode</span></td><td><span>输入</span></td><td><span>程序是否使用Unicode字符集</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>TCHAR  cErrMessage[256];  </span><br><span>short  siRtn =  EMIO_Get_First_Error_Message ( cErrMessage , 0 );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>StringBuilder ErrorMsg = new StringBuilder(&quot;&quot;,  100);  </span><br><span>short siRtn = EMIO. EMIO_Get_First_Error_Message ( ErrorMsg, 0 );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="332-emiogetlasterrormessage" class="md-header-anchor"></a><span>3.3.2 EMIO_Get_Last_Error_Message()</span></h3><p><span>获取系统出现的最后一个错误信息。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Last_Error_Message</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short    EMIO_Get_Last_Error_Message(  LPTSTR Error_Message, unsigned short Unicode = 1  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>根据指定字符集类型获取系统出现的最后一个错误信息字符数组。Unicode类型定义如下：( 0 : 非Unicode  )  ( 1 : Unicode )</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>LPTSTR</span></td><td><span>Error_Message</span></td><td><span>输出</span></td><td><span>返回系统出现的最后一个错误信息</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Unicode</span></td><td><span>输入</span></td><td><span>程序是否使用Unicode字符集</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>TCHAR  cErrMessage[256];  </span><br><span>short  siRtn =  EMIO_Get_Last_Error_Message ( cErrMessage , 0 );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>StringBuilder ErrorMsg = new  StringBuilder(&quot;&quot;, 100);  </span><br><span>short siRtn = EMIO. EMIO_Get_Last_Error_Message ( ErrorMsg, 0 );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="333-emiogeterrormessage" class="md-header-anchor"></a><span>3.3.3 EMIO_Get_Error_Message()</span></h3><p><span>根据指定错误代码和指定字符集获取具体错误信息。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Error_Message</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><strong><span>函数原型</span></strong></td><td><span>short    EMIO_Get_Error_Message ( LPTSTR  Error_Message, short Error_Code,  unsigned short  Unicode = 1  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>根据错误代码 Error_Code和字符集 Unicode获取具体错误信息字符数组。Unicode类型定义如下：( 0 : 非Unicode  )  ( 1 : Unicode )</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>LPTSTR</span></td><td><span>Error_Message</span></td><td><span>输出</span></td><td><span>返回具体的错误信息</span></td></tr><tr><td><span>short</span></td><td><span>Error_Code</span></td><td><span>输入</span></td><td><span>具体的错误代码</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Unicode</span></td><td><span>输入</span></td><td><span>程序是否使用Unicode字符集</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>TCHAR cErrMessage[256];  </span><br><span>short siRtn = EMIO_Get_Error_Message(  cErrMessage , -18, 0 );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>StringBuilder  ErrorMsg = new StringBuilder(&quot;&quot;, 100);  </span><br><span>short  siRtn = EMIO.EMIO_Get_Error_Message( ErrorMsg, -18, 0 );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="334-emiogetsn" class="md-header-anchor"></a><span>3.3.4 EMIO_Get_SN()</span></h3><p><span>获取指定站点的硬件序列号信息。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_SN</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short    EMIO_Get_SN ( INT64  *Serial_Number, unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定站点 Station_Number的硬件序列号信息返回到 Serial_Number变量中。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>INT64 *</span></td><td><span>Serial_Number</span></td><td><span>输出</span></td><td><span>返回硬件序列号，维一的64位硬件码</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>INT64  lSN =0;  </span><br><span>short  siRtn =  EMIO_Get_SN(&amp;lSN,  Station_Numbers[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>Int64 lSN = 0;  </span><br><span>short siRtn = EMIO.EMIO_Get_SN(ref lSN,  gStation_Numbers[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="335-emiogetsntext" class="md-header-anchor"></a><span>3.3.5 EMIO_Get_SN_Text()</span></h3><p><span>获取指定站点的硬件序列号信息字符数组。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_SN_Text</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short    EMIO_Get_SN_Text (LPTSTR  Serial_Number, unsigned short Station_Number, unsigned short   Unicode = 1);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定站点 Station_Number的硬件序列号返回到 Serial_Number字符数组中。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>LPTSTR</span></td><td><span>Serial_Number</span></td><td><span>输出</span></td><td><span>返回硬件序列号，维一的64位硬件码</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Unicode</span></td><td><span>输入</span></td><td><span>程序是否使用Unicode字符集</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>TCHAR pszStationSN[MAX_PATH] = {0};   </span><br><span>short siRtn =   EMIO_Get_SN_Text ( pszStationSN , Station_Numbers[0] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>StringBuilder  SN = new StringBuilder(&quot;&quot;,  100);  </span><br><span>short  siRtn =  EMIO.EMIO_Get_SN_Text(SN, 0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h3><a name="336-emiogetstationinfo" class="md-header-anchor"></a><span>3.3.6 EMIO_Get_Station_Info()</span></h3><p><span>获取指定站点的站点信息。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Station_Info</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short  EMIO_Get_Station_Info (unsigned long * Station_Info ,  unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定站点 Station_Number的站点信息返回到  Station_Info 数组中。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned long *</span></td><td><span>Station_Info</span></td><td><span>输出</span></td><td><span>返回站点信息(类型 固件版本)</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>unsigned  long ulStationInfo = 0;  </span><br><span>short  siRtn = EMIO_Get_Station_Info( ulStationInfo  , Station_Numbers[0] );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>uint   ulStationInfo = 0;  </span><br><span>short  siRtn = EMIO.EMIO_Get_Station_Info(ref  ulStationInfo, gStation_Numbers[0]);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="337-emiogetdllversion" class="md-header-anchor"></a><span>3.3.7 EMIO_Get_Dll_Version()</span></h3><p><span>获取软件动态库版本信息。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Dll_Version</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Get_Dll_Version (LPTSTR DllVersion);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取软件动态库版本信息返回到 DllVersion 字符数组中。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>LPTSTR</span></td><td><span>DllVersion</span></td><td><span>输出</span></td><td><span>返回软件动态库版本信息</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>TCHAR pszFileVersion[MAX_PATH] = {0};   </span><br><span>short  siRtn =  EMIO_Get_Dll_Version(pszFileVersion);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>StringBuilder  Version = new StringBuilder(&quot;&quot;, 100);  </span><br><span>short  siRtn =  EMIO.EMIO_Get_Dll_Version(Version);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="338-emiogetlanguage" class="md-header-anchor"></a><span>3.3.8 EMIO_Get_Language()</span></h3><p><span>获取软件动态库错误信息语言类型。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Language</span></strong></th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short    EMIO_Get_Language ();</span></td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取并返回软件动态库错误信息语言类型。(  0 : 简体中文 ) ( 1 : 英文 ) 默认中文</span></td><td>&nbsp;</td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short  siLanguage =  EMIO_Get_Language();</span></td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  siLanguage =  EMIO.EMIO_Get_Language();</span></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="339-emiosetlanguage" class="md-header-anchor"></a><span>3.3.9 EMIO_Set_Language()</span></h3><p><span>设置软件动态库错误信息语言类型。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Set_Language</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short    EMIO_Set_Language ( short Language );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>设置软件动态库错误信息语言类型。(  0 : 简体中文 ) ( 1 : 英文 )</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>short</span></td><td><span>Language</span></td><td><span>输入</span></td><td><span>错误信息语言类型</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short siRtn =  EMIO_Set_Language(0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  siRtn =  EMIO.EMIO_Set_Language(1);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3310-emiogetprocesstype" class="md-header-anchor"></a><span>3.3.10 EMIO_Get_Process_Type()</span></h3><p><span>获取进程的类型。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_</span></strong><span> </span><strong><span>Process_Type</span></strong></th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Get_Process_Type ();</span></td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取并返回进程的类型。(0  : 32位进程 ) (  1 : 64位进程 )</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short  siProcessType =  EMIO_Get_Process_Type();</span></td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  siProcessType =  EMIO. EMIO_Get_Process_Type();</span></td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3311-emioregistercallbackevent" class="md-header-anchor"></a><span>3.3.11 EMIO_Register_Callback_Event()</span></h3><p><span>注册断线，重连或断电回调事件。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Register_Callback_Event</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short    EMIO_Register_Callback_Event ( PFEMIO_Callback_Event  CallbackFunc,  unsigned short EventType  );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>注册断线或重连回调事件。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>PFEMIO_Callback_Event</span></td><td><span>CallbackFunc</span></td><td><span>输入</span></td><td><span>回调事件函数指针。</span></td></tr><tr><td><span>unsigned short</span></td><td><span>EventType</span></td><td><span>输入</span></td><td><span>回调事件类型。  0: YSEventStationsDisconnected   1: YSEventStationsInterrupReconnected  2: YSEventStationsPowerOffReconnected</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>//1.自定义一个被回调函数  </span><br><span>short  WINAPI CallbackEventStationsDisconnected()  </span><br><span>{    CString sDisconnected=  (CTime::GetCurrentTime()).Format(_T(&quot;模块已断线  %Y%m%d %H%M%S&quot;) );    return 0;  </span><br><span>}  </span><br><span>//2.在打开从站模块后  注册被回调函数及其类型  EMIO_Register_Callback_Event(CallbackEventStationsDisconnected,  YSEventStationsDisconnected);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>//1.自定义一个事件处理函数  </span><br><span>public static void  StationsDisconnectedEventProc()  </span><br><span>{  String sDisconnected =&quot;模块已断线&quot;;  } </span><br><span> //2.声明并新建一个事件委托及其处理函数  </span><br><span>EMIO_Callback_Event  StationsDisconnectedEvent  = new EMIO. EMIO_Callback_Event ( StationsDisconnectedEventProc );  </span><br><span>//3.在打开从站模块后 注册事件委托及其类型  EMIO.EMIO_Register_Callback_Event(  StationsDisconnectedEvent , 0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3312-emiogetdisconnectcounts" class="md-header-anchor"></a><span>3.3.12 EMIO_Get_Disconnect_Counts()</span></h3><p><span>获取网络掉线的次数。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Disconnect_Counts</span></strong></th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Get_Disconnect_Counts ();</span></td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取网络掉线的次数。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short  uiDisCnts = EMIO_Get_Disconnect_Counts();</span></td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  uiDisCnts = EMIO. EMIO_Get_Disconnect_Counts();</span></td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3313-emiosetdisconnectcounts" class="md-header-anchor"></a><span>3.3.13 EMIO_Set_Disconnect_Counts()</span></h3><p><span>设置网络掉线的次数。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Set_Disconnect_Counts</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Set_Disconnect_Counts (short  Disconnect_Counts );</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>设置网络掉线的次数。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>short</span></td><td><span>Disconnect_Counts</span></td><td><span>输入</span></td><td><span>设置网络掉线的次数，清零</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short siRtn  = EMIO_Set_Disconnect_Counts(0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  siRtn  = EMIO. EMIO_Set_Disconnect_Counts(0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3314-emiogetinterrupreconnectcounts" class="md-header-anchor"></a><span>3.3.14 EMIO_Get_Interrup_Reconnect_Counts()</span></h3><p><span>获取网络中断掉线后重新连接的次数。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_Interrup_Reconnect_Counts</span></strong></th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Get_Interrup_Reconnect_Counts ();</span></td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取网络中断后重新连接的次数。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short uiInterrupReCnts =  EMIO_Get_Interrup_Reconnect_Counts();</span></td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short uiInterrupReCnts = EMIO.EMIO_Get_Interrup_Reconnect_Counts();</span></td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3315-emiosetinterrupreconnectcounts" class="md-header-anchor"></a><span>3.3.15 EMIO_Set_Interrup_Reconnect_Counts()</span></h3><p><span>设置网络中断掉线后重新连接的次数。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Set_Interrup_Reconnect_Counts</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Set_Interrup_Reconnect_Counts ( short Interrup_Reconnect_Counts);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>设置网络中断掉线后重新连接的次数。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>short</span></td><td><span>Interrup_Reconnect_Counts</span></td><td><span>输入</span></td><td><span>设置网络中断掉线后重连的次数，清零</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short siRtn = EMIO_Set_Interrup_Reconnect_Counts(0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short  siRtn = EMIO.EMIO_Set_Interrup_Reconnect_Counts(0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3316-emiogetpoweroffreconnectcounts" class="md-header-anchor"></a><span>3.3.16 EMIO_Get_PowerOff_Reconnect_Counts()</span></h3><p><span>获取指定站点模块断电后重新连接的次数。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Get_PowerOff_Reconnect_Counts</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Get_PowerOff_Reconnect_Counts (unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>获取指定站点模块断电后重新连接的次数。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short uiReCnts = EMIO_Get_PowerOff_Reconnect_Counts(0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short uiReCnts  = EMIO.EMIO_Get_PowerOff_Reconnect_Counts(1);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h3><a name="3317-emiosetpoweroffreconnectcounts" class="md-header-anchor"></a><span>3.3.17 EMIO_Set_PowerOff_Reconnect_Counts()</span></h3><p><span>设置指定站点模块断电后重新连接的次数。</span></p><figure><table><thead><tr><th>&nbsp;</th><th><strong><span>EMIO_Set_PowerOff_Reconnect_Counts</span></strong></th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>函数原型</span></td><td><span>short   EMIO_Set_PowerOff_Reconnect_Counts (short PowerOff_Reconnect_Counts ,  unsigned short Station_Number);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>说明</span></strong></td><td><span>设置指定站点模块断电后重新连接的次数。</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>原型参数</span></strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>类型</span></strong></td><td><strong><span>名称</span></strong></td><td><strong><span>类型</span></strong></td><td><strong><span>说明</span></strong></td></tr><tr><td><span>short</span></td><td><span>PowerOff_Reconnect_Counts</span></td><td><span>输入</span></td><td><span>设置站点模块断电后重新连接的次数</span></td></tr><tr><td><span>unsigned short</span></td><td><span>Station_Number</span></td><td><span>输入</span></td><td><span>从站模块的站点ID序号。</span></td></tr><tr><td><strong><span>C++示例</span></strong></td><td><span>short  siRtn = EMIO_Set_PowerOff_Reconnect_Counts(0,0);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><strong><span>C#</span></strong><span> </span><strong><span>示例</span></strong></td><td><span>short siRtn = EMIO.EMIO_Set_PowerOff_Reconnect_Counts(0,1);</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p><span> </span></p><h1><a name="第4章-常见问题faq" class="md-header-anchor"></a><span>第4章 常见问题FAQ</span></h1><h2><a name="41-硬件常见faq" class="md-header-anchor"></a><span>4.1 硬件常见FAQ</span></h2><p><span>Q: 总线式系统架构是否可以同时用两个或多个网口连接并同时打开所有从站模块？</span></p><p><span>A: </span><strong><span>不可以</span></strong><span>！为保证通讯的实时及稳定性，同一时间段内只能打开一个网口串联的所有从站模块。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/115133_06a400f9_1360849.png"></div>
<p align="center">图4.1.1 总线式系统架构</p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: NET_IN和NET_OUT口接入顺序可不可以接反？</span></p><p><span>A: </span><strong><span>不可以</span></strong><span>！如果API一直返回打开站点不成功，请先确认网线的接入顺序，必须严格按照从NET_IN口接入，串接的话从NET_OUT接出，如不串接，端回环接头必须接NET_OUT口。</span></p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: 可以不接终端回环接头么？</span></p><p><span>A: </span><strong><span>不可以</span></strong><span>！必须接终端回环接头。</span></p><p><span>(1). 不接终端回环接头, 返回打开站点不成功</span></p><p><span>(2). 接了终端回环接头, 打开站点成功后，拨掉回环头，报网络链接中断；重新插上后，恢复正常。</span></p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: 总线式系统架构最多可以串联多少个模块？</span></p><p><span>A: 为保证通讯周期1ms，总线式系统架构最多可以级联56个模块。以48DI32DO来算，最多总共可以控制80x56=4480点(2784DO/896DI) 。</span></p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: 如果级联少于56个模块，总线通讯周期会少于1ms么？</span></p><p><span>A: 不会，总线通讯周期依然是1ms，如果需要更改总线通讯周期，请联系厂商客制化 。</span></p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: 可以使用普通的非屏蔽网线么？</span></p><p><span>A: </span><strong><span>不可以</span></strong><span>！网络线缆的质量对通讯的稳定性有极其重要的作用，非屏蔽/普通/劣质网线容易引起网络断线及通讯不稳定。请使用厂商经过测试的配套超6类双屏蔽网线（CAT6e SFTP） 。</span></p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: API函数是否支持Linux和 Mac系统？</span></p><p><span>A: 目前暂时不支持，如果需要其他操作系统支持，请联系厂商客制化 。</span></p><p><span>/-----------------------------------------------------------------------------------------------------------------</span></p><p><span>Q: 电脑主站网口是否要设置固定IP地址？</span></p><p><span>A: </span><strong><span>需要</span></strong><span>！设置与模块连接的电脑主站网口为固定IP地址，由于Windows的网络接口特性，固定IP地址不仅能使通讯更加稳定，而且能加快网络断线与重连的速度。</span></p><div align="center"><img src="https://images.gitee.com/uploads/images/2019/1230/115151_e32e35e1_1360849.png"></div>
<p align="center">图4.1.2 设置网络连接固定IP地址</p><h2><a name="42-软件常见faq" class="md-header-anchor"></a><span>4.2 软件常见FAQ</span></h2><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><table>    
    <tbody><tr><th colspan="5"><center>修订历史</center></th></tr>
  <tr><td>修订版本</td><td>修订内容</td><td>适用硬件</td><td>修改时间</td><td>修改者</td></tr>
  <tr><td>V1.0</td><td>第一版发行</td><td>EIO2416  EIO4832</td><td>201909</td><td>XX</td></tr>
  <tr><td>V1.0</td><td>增加断线及重连回调事件功能</td><td>EIO2416  EIO4832</td><td>201910</td><td>XX</td></tr>
  <tr><td>V1.0</td><td>增加断电重连回调事件及Utitlity</td><td>EIO2416  EIO4832</td><td>201912</td><td>XX</td></tr>
</tbody></table><p><span> </span></p></div>
</body>
</html>